package com.infoland.afanmall.model.fuPin.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.infoland.afanmall.R;
import com.infoland.afanmall.base.util.ToolsKit;
import com.infoland.afanmall.model.fuPin.entity.FuPinGoodsResponse;

import java.util.List;

/**
 * @author 王永吉
 * @date 2018/7/2 15:06
 * 扶贫管商品适配器
 */
public class FpGoodsAdapter extends BaseQuickAdapter<FuPinGoodsResponse.ObjectBean.ListBean, BaseViewHolder> {
    public FpGoodsAdapter(int layoutResId, @Nullable List<FuPinGoodsResponse.ObjectBean.ListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, FuPinGoodsResponse.ObjectBean.ListBean item) {
        ToolsKit.setImgView(item.getF_url(), helper.getView(R.id.fu_pin_item_image));
        helper.setText(R.id.fu_pin_item_txt_name, item.getG_name());
        helper.setText(R.id.fu_pin_item_txt_content, item.getG_introduction());
        helper.setText(R.id.fu_pin_item_txt_price1, "￥" + item.getG_price() + "");
        helper.setText(R.id.fu_pin_item_txt_price2, "￥" + item.getG_origin_price() + "");
        ToolsKit.setTextDelete(helper.getView(R.id.fu_pin_item_txt_price2));
    }
}
